/**
*****************************************************************************
 * DESC ：. 
 * Author : Junwei Zhang 
 * CREATEDATE ：2012-7-22 
 * MODIFYLIST ：       	Name 			 Date 			Reason/Contents
 * 				------------------------------------------------------ 
 * 				 	Junwei Zhang     2012-7-22		Created.
 ****************************************************************************
**/
package com.me.test;

import static org.junit.Assert.*;

import org.junit.Test;

/**
 * 
 * <br/> 下午8:37:04 2012-7-22
 * @Author <a href="mailto:mestudying@sina.com">Junwei Zhang</a><br/>
 **/
public class FoundationTester {

	@Test
	public void test() {
		String s = "1";
		System.out.print("-----value-----" + (s == null || !s.equals("2") || !s.equals("3")));
	}
	
	@Test
	public void testSplit(){
		// String s = "111, ";
		String[] users = parseParams("createChatRoom(\"111-room\",\"111,\")");
		for(String u : users){
			System.out.println("-------user------" + u);
		}
	}
	
	private String[] parseParams(String method) {
		// TODO Auto-generated method stub
		String strParams = method.substring(method.indexOf('(') + 1, method.lastIndexOf(')'));
		String[] params = strParams.split("\"[\\s]*,[\\s]*\"");
		if(params == null || params.length < 1 || (params.length == 1 && params[0].equals(""))){
			return null;
		}else{
			params[0] = params[0].replaceFirst("\"", "");
			params[params.length - 1] = params[params.length - 1].replaceFirst("\"", "");
		}
		return params;
	}
}
